local skel = fk.CreateSkill {
  name = "efengqi__chengxiong",
}

Fk:loadTranslationTable{
  ["efengqi__chengxiong"] = "逞凶",
  [":efengqi__chengxiong"] = "你可以将一张♠牌当【酒】使用；使用者为你或目标含你的♠牌无视次数与距离。",
  ["#efengqi__chengxiong"] = "逞凶:你可以将一张♠牌当【酒】使用",

  ["$efengqi__chengxiong1"] = "呃……再来……一壶……",
  ["$efengqi__chengxiong2"] = "好酒！好酒！",
}

skel:addEffect("viewas", {
  anim_type = "offensive",
  pattern = "analeptic",
  prompt = "#efengqi__chengxiong",
  card_filter = function (self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select).suit == Card.Spade
  end,
  view_as = function (self, player, cards)
    if #cards ~= 1 then return nil end
    local c = Fk:cloneCard("analeptic")
    c.skillName = skel.name
    c:addSubcard(cards[1])
    return c
  end,
})

skel:addEffect("targetmod", {
  bypass_times = function(self, player, skill, scope, card, to)
    -- 太愚蠢了，酒的canUse用无色牌判断，无法令指定花色的牌无次数限制
    if card and table.contains(card.skillNames, skel.name) then return true end
    if card and card.suit == Card.Spade then
      return player:hasSkill(skel.name) or (to and to:hasSkill(skel.name))
    end
  end,
  bypass_distances = function (self, player, skill, card, to)
    if card and card.suit == Card.Spade then
      return player:hasSkill(skel.name) or (to and to:hasSkill(skel.name))
    end
  end,
})

return skel
